home > .cgi > Uploading CGI

 

.home
.news
.sites
.free downloads
.tips & tricks
.web builder
.cgi
.intro to Perl
.your own server
.add a chatroom
.uploading CGI
.bughunting
.using PWS
.smart ass
.resources
.in-depth articles
.magazine
.forums
.contacts
.site map
.IE5 companion
.cgi
Need to supercharge your Web site? Got a database of products, and no way to get them online. You need to harness the power of CGI programming. Using languages such as Perl, ASP and PHP, you can create interactive, intelligent sites. This is part one of the series that appeared in .net magazine. Subscribe now so you don't any of the upcoming articles!
 

Uploading your CGI

 

Click to view full size

One

Set up an account with a host that gives you cgi-bin access and get your hands on an FTP client, such as CuteFTP or LeechFTP. Make sure the transfer type is set to ASCII or Text - or your Perl program will not work. Then upload test-perl.pl to your cgi-bin.

Two

If you're using a Unix type host, such as www.uklinux.net, you must set the file permissions on any script you upload to 755. Right click on the file and select CHMOD (CuteFTP) or Set Attributes (LeechFTP). Check the cgi-bin directory itself has the same permissions.

Click to view full size

 

 

Click to view full size

Three

Point your browser at your script - something like www.you.yourhost.net/cgi-bin/test-perl.pl. Scroll down the list of environment variables until you get to one like SCRIPT_FILENAME. This should show you the absolute path to your Web directory and cgi-bin.

Four

If you get an error 500 or an 'Internal Server Error, you probably didn't set the transfer type to ASCII. Delete the file and upload it again, transferring it as ASCII. Then check you've got the permissions right. The magic 755 tells the server it's an executable script.

Click to view full size

 

 

Click to view full size

Five

Now create directories for your Web pages exactly as you had them on your hard drive. Right-click your messages directory and change its permission to 777 - this tells the server that anyone can read, write or change into it.

Six

Upload chatform.html and chatframes.html to your chat directory, then upload messages.html to the messages subdirectory. Right-click on messages.html and change its permissions to 666 - this ensures the EveryChat can update the file with new messages.

Click to view full size

 

 

Click to view full size

Seven

Now edit everycht.cgi. Look for the $filepath='…' line in the configuration part, and change it to the absolute path to your messages directory. It should have a forward slash at the beginning and end, something like '/www/me.myhost.net/chat/messages/'

Eight

Save your work and upload it to your cgi-bin. Change it's permissions to 755 so it's executable, then point your browser at chatframes.html. If all's gone well, you'll be able to log on and start chatting right away. Congratulations!

Click to view full size

 


click here for print version of this story.






|.home|.news|.sites|.free downloads|.tips & tricks|.web builder|.in-depth articles|.magazine|.forums|.contacts|.sitemap|
Copyright Future Publishing 2001. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission from Future Publishing is prohibited. If you have any questions relating to the site, please contact the webmaster.
Click here for our Privacy statement.